#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
# Copyright © chrisZheng
# CreateTime: 2016-01

username = ['cisco','chris','chris2007']
password = ['cisco','chris','chris2007']
#def aaa_auth (name):
#    if name == username[0]:return password[0]
#	elif name == username[1]:return password[1]
#	elif name == username[2]:return password[2]
#	elif name == username[3]:return password[3]
def username1(auth):
	if auth == username[0]:return username[0]
	elif auth == username[1]:return username[1]
	elif auth == username[2]:return username[2]
err = 0
while True:
	auth_name1 = input('username:')
	if auth_name1 == username1(auth_name1):
		auth_password1 = input('password:')
		if auth_password1 == aaa_auth(auth_name1):
			print ('welcome to login this router! /nR108-ASR1002-001#')
		else:
			print ('password error')
	else:
		err +=1
		print ('username is not in service,please call system admin')
		if err >= 3:
			print ('password error, system login out. ')
			break
		else:pass